home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Dialectic 1.2 / source / Dialectic ƒ / Raw dialects ƒ / ubby.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  2.0 KB  |  81 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        ubby.c
  4.  
  5. Purpose:    This module handles actually converting text into Ubby talk.
  6.  
  7.  
  8. Dialectic -=- dialect text conversion extraordinare
  9. Copyright ©1994, Mark Pilgrim
  10.  
  11. This program is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2 of the License, or
  14. (at your option) any later version.
  15.  
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with this program in a file named "GNU General Public License".
  23. If not, write to the Free Software Foundation, 675 Mass Ave,
  24. Cambridge, MA 02139, USA.
  25.  
  26. \**********************************************************************/
  27.  
  28. #include "dialectic dispatch.h"
  29. #include "dialectic utilities.h"
  30. #include "program globals.h"
  31.  
  32. void ConvertUbby(void)
  33. {
  34.     char            oneChar;
  35.     
  36.     oneChar=(ThisChar())|0x20;
  37.     
  38.     if (oneChar=='a')
  39.     {
  40.         StoreString(IsUpperAlpha(ThisChar()) ? IsUpperAlpha(NextChar(1)) ?
  41.             "\pUHBA" : "\pUhba" : "\puhba");
  42.         InputPlus(1);
  43.         return;
  44.     }
  45.     
  46.     if (oneChar=='e')
  47.     {
  48.         StoreString(IsUpperAlpha(ThisChar()) ? IsUpperAlpha(NextChar(1)) ?
  49.             "\pUHBE" : "\pUhbe" : "\puhbe");
  50.         InputPlus(1);
  51.         return;
  52.     }
  53.     
  54.     if (oneChar=='i')
  55.     {
  56.         StoreString(IsUpperAlpha(ThisChar()) ? IsUpperAlpha(NextChar(1)) ?
  57.             "\pUHBI" : "\pUhbi" : "\puhbi");
  58.         InputPlus(1);
  59.         return;
  60.     }
  61.     
  62.     if (oneChar=='o')
  63.     {
  64.         StoreString(IsUpperAlpha(ThisChar()) ? IsUpperAlpha(NextChar(1)) ?
  65.             "\pUHBO" : "\pUhbo" : "\puhbo");
  66.         InputPlus(1);
  67.         return;
  68.     }
  69.     
  70.     if (oneChar=='u')
  71.     {
  72.         StoreString(IsUpperAlpha(ThisChar()) ? IsUpperAlpha(NextChar(1)) ?
  73.             "\pUHBU" : "\pUhbu" : "\puhbu");
  74.         InputPlus(1);
  75.         return;
  76.     }
  77.     
  78.     StoreChar(ThisChar());
  79.     InputPlus(1);
  80. }
  81.